<template>
  <div>
    <div class="page_tab_top">
      <div
        class="tab_list_item"
        @click="cutTab(1)"
        :class="currentIndex === 1 ? 'tab_active' : ''"
      >
        底薪绩效配置
      </div>
      <div
        class="tab_list_item"
        @click="cutTab(2)"
        :class="currentIndex === 2 ? 'tab_active' : ''"
      >
        店长提成配置
      </div>
    </div>
    <managerSalarySet
      ref="managerSalarySet"
      v-show="this.currentIndex === 1"
    ></managerSalarySet>
    <storeManagerSalary
      ref="storeManagerSalary"
      v-show="this.currentIndex === 2"
    ></storeManagerSalary>
  </div>
</template>

<script>
import managerSalarySet from "./managerSalarySet.vue";
import storeManagerSalary from "./storeManagerSalary.vue";

export default {
  components: {
    managerSalarySet,
    storeManagerSalary,
  },
  name: "Eryustoreadminindex",

  data() {
    return {
      currentIndex: 1,
    };
  },

  mounted() {
    this.$nextTick(() => {
      this.changeChild();
    });
  },

  methods: {
    //  // 顶部tab切换
    cutTab(i) {
      this.currentIndex = i;
      this.changeChild();
    },

    changeChild() {
      if (this.currentIndex === 1) {
        this.$refs.managerSalarySet.resQ();
      } else if (this.currentIndex === 2) {
        this.$refs.storeManagerSalary.resQ();
      }
    },
  },
};
</script>

<style lang="scss" scoped></style>
